/*
Copyright (C) 2010 
Author		  Oliver Schenk
Contact		  Oliver.Schenk76@gmail.com

This program is free software; you can redistribute
it and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.
This program is distributed in the hope that it will be useful, 
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; 
if not, see <http://www.gnu.org/licenses/>.
*/

package SelfBookingSystem;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.jdo.PersistenceManager;
import javax.jdo.Query;


public class GetUserToAppID {
	public static Map<String, String> GetUserToAppID(String AppID){
		Map<String, String> m = new HashMap<String, String>();
		PersistenceManager pm = PMF.get().getPersistenceManager();
		
		Query query = pm.newQuery(UserToAppID.class);
		query.setFilter("AppID == AppIDParam");
	    query.declareParameters("String AppIDParam");
		List<UserToAppID> ConfigurationValues = (List<UserToAppID>) pm.newQuery(query).execute(AppID);		
		
		
		for (UserToAppID cg : ConfigurationValues) {
			m.put("AppID", cg.getAppID());
			m.put("User", cg.getUser());
			m.put("Level", cg.getLevel());
		}
		return m;
	}
}
